home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
SpinFetchAndOp.h,v
< prev
next >
Wrap
Text File
|
1989-02-23
|
2KB
|
182 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @ * @;
3.2
date 89.02.20.15.37.38; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.20; author grunwald; state Exp;
branches ;
next 1.3;
1.3
date 88.10.30.13.06.09; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.09.28.22.13.44; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.21.20.51.47; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef SpinFetchAndOp_h
#define SpinFetchAndOp_h
//
// Fetch and op for hardware CPUS
//
#include "SpinLock.h"
#include "Config.h"
class SpinFetchAndOp : public SpinLock {
int data;
public:
SpinFetchAndOp(int);
void set(int);
int add(int);
int unlockedAdd(int);
int value();
};
inline
SpinFetchAndOp::SpinFetchAndOp(int d)
{
data = d;
}
inline void
SpinFetchAndOp::set(int d)
{
data = d ;
}
#ifndef USE_SHARED_MEMORY
inline int
SpinFetchAndOp::add(int d)
{
int was = data;
data += d;
return(was);
}
#endif
inline int
SpinFetchAndOp::unlockedAdd(int d)
{
int was = data;
data += d;
return(was);
}
inline int
SpinFetchAndOp::value()
{
return(data);
}
#endif /* SpinFetchAndOp_h */
@
3.1
log
@Steay version
@
text
@@
1.3
log
@*** empty log message ***
@
text
@@
1.2
log
@*** empty log message ***
@
text
@d1 3
a3 2
#ifndef HardFetchAndOp_h
#define HardFetchAndOp_h
d5 5
d13 2
a14 1
#include "HardSpinLock.h"
d16 1
a16 1
class HardFetchAndOp : public HardSpinLock {
d19 1
a19 1
HardFetchAndOp(int);
d27 1
a27 1
HardFetchAndOp::HardFetchAndOp(int d)
d33 1
a33 1
HardFetchAndOp::set(int d)
d38 9
d49 1
a49 1
HardFetchAndOp::unlockedAdd(int d)
d57 1
a57 1
HardFetchAndOp::value()
d61 1
a61 1
#endif /* HardFetchAndOp_h */
@
1.1
log
@Initial revision
@
text
@d19 1
d25 1
a25 1
void
d31 2
a32 1
int
d35 1
d37 1
a37 1
return(data);
d40 1
a40 1
int
@